<div bsModal #createOrEditModal="bs-modal" class="modal fade" tabindex="-1" role="dialog"
    aria-labelledby="createOrEditModal" aria-hidden="true" [config]="{backdrop: 'static'}">
    <div class="modal-dialog modal-xl">
        <div class="modal-content">
            <form *ngIf="active" #roleForm="ngForm" novalidate (ngSubmit)="save()" autocomplete="off">
                <div class="modal-header">
                    <h4 class="modal-title">
                        <span *ngIf="wl.materialForProduct.id">编辑物流单</span>
                        <span *ngIf="!wl.materialForProduct.id">新建物流单</span>
                    </h4>
                    <button type="button" class="close" (click)="close()" [attr.aria-label]="l('Close')">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body ruku" >
                        <h5 class="mb-4" style="font-weight: 600;">
                                <i class="fa fa-list"></i> 基础信息</h5>
                                <div style="border:1px solid #e9ecef ;padding: 10px">
                            <div class="row">
                            <div class="col-md-3">

                                    <div class="form-group">
                                            <label>任务号 : </label>
                                        <input #materialNameInput="ngModel" class="form-control" type="text" name="materialName" style="float:right;width:75%"
                                            [(ngModel)]="wl.materialForProduct.requestedTaskNum">
                                    </div>
                                </div>
                                <div class="col-md-3">
                                    <label>图号 :</label>
                                    <div class="form-group">
                                        <input class="form-control" type="text" name="invFurBatch" style="float:right;width:75%"
                                            [(ngModel)]="wl.materialForProduct.requestedDrawingNum">
                                    </div>
                                </div>

                                <div class="col-md-3">
                                    <label>件数<span style="color:red">*</span>:</label>
                                    <div class="form-group">
                                        <input class="form-control" type="text" name="invFurBatch" style="float:right;width:75%"
                                            [(ngModel)]="wl.materialForProduct.itemAmount" required>
                                    </div>
                                </div>
                                <div class="col-md-3">
                                        <label>物资名称<span style="color:red">*</span> :</label>
                                        <div class="form-group">
                                            <input #materialNameInput="ngModel" class="form-control" type="text" name="materialName" style="float:right;width:65%"
                                                [(ngModel)]="wl.materialForProduct.displayName" required>
                                            <validation-messages [formCtrl]="materialNameInput"></validation-messages>
                                        </div>
                                    </div>
                    </div>

                    <div class="row">
                            <div class="col-md-3">
                                    <label>数量(重量) :</label>
                                    <div class="form-group">
                                        <input class="form-control" type="text" name="hgzNo" style="float:right;width:65%"
                                            [(ngModel)]="wl.materialForProduct.quantity">
                                    </div>
                                </div>
                                <div class="col-md-3">
                                    <label>单价<span style="color:red">*</span> :</label>
                                    <div class="form-group">
                                        <input class="form-control" type="text" name="taskCode" style="float:right;width:75%"
                                            [(ngModel)]="wl.materialForProduct.unitPrice" required>
                                    </div>
                                </div>
                        <div class="col-md-3">
                            <label>总价<span style="color:red">*</span> :</label>
                            <div class="form-group">
                                <input class="form-control" type="text" name="drawingCode" style="float:right;width:75%"
                                    [(ngModel)]="wl.materialForProduct.totalPrice" required>
                            </div>
                        </div>
                        <div class="col-md-3">
                            <label>生产厂家 :</label>
                            <div class="form-group">
                                <input class="form-control" type="text" name="invCode" style="float:right;width:70%"
                                    [(ngModel)]="wl.materialForProduct.manufacturer">
                            </div>
                        </div>

                    </div>

                    <div class="row">
                        <div class="col-md-3">
                            <label>牌号 :</label>
                            <div class="form-group">
                                <input #billNoInput="ngModel" class="form-control" type="text" name="billNo" style="float:right;width:75%"
                                    [(ngModel)]="wl.materialForProduct.materialModel">
                                <validation-messages [formCtrl]="billNoInput"></validation-messages>
                            </div>
                        </div>
                        <div class="col-md-3">
                            <label>规格 :</label>
                            <div class="form-group">
                                <input class="form-control" type="text" name="specification" style="float:right;width:75%"
                                    [(ngModel)]="wl.materialForProduct.specification">
                            </div>
                        </div>

                        <div class="col-md-3">
                            <label>合格证 :</label>
                            <div class="form-group">
                                <input class="form-control" type="text" name="certificateNo" style="float:right;width:75%"
                                    [(ngModel)]="wl.materialForProduct.certificateNo">
                            </div>
                        </div>
                        <div class="col-md-3">
                            <label>质检单号 :</label>
                            <div class="form-group">
                                <input class="form-control" type="text" name="qualityCheckBillNo" style="float:right;width:70%"
                                    [(ngModel)]="wl.materialForProduct.qualityCheckBillNo">
                            </div>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-md-3">
                            <label>物资编码 :</label>
                            <div class="form-group">
                                <input class="form-control" type="text" name="materialCode" style="float:right;width:70%"
                                    [(ngModel)]="wl.materialForProduct.materialCode">
                            </div>
                        </div>
                        <div class="col-md-3">
                            <label>炉批号 :</label>
                            <div class="form-group">
                                <input class="form-control" type="text" name="furnaceBatch" style="float:right;width:75%"
                                    [(ngModel)]="wl.materialForProduct.furnaceBatch">
                            </div>

                        </div>
                        <div class="col-md-3">
                            <label>尺寸 :</label>
                            <div class="form-group">
                                <input class="form-control" type="text" name="size" style="float:right;width:75%"
                                    [(ngModel)]="wl.materialForProduct.size">
                            </div>
                        </div>
                        <div class="col-md-3">
                            <label>物资状态 :</label>
                            <div class="form-group">
                                <input class="form-control" type="text" name="materialStatus" style="float:right;width:70%"
                                    [(ngModel)]="wl.materialForProduct.materialStatus">
                            </div>

                        </div>
                    </div>

                    <div class="row">
                        <div class="col-md-3">
                            <label>技术条件 :</label>
                            <div class="form-group">
                                <input class="form-control" type="text" name="techCondition" style="float:right;width:70%"
                                    [(ngModel)]="wl.materialForProduct.techCondition">
                            </div>
                        </div>
                        <div class="col-md-3">
                            <label>质疑单号 :</label>
                            <div class="form-group">
                                <input class="form-control" type="text" name="qualityProblemBillNo" style="float:right;width:70%"
                                    [(ngModel)]="wl.materialForProduct.qualityProblemBillNo">
                            </div>

                        </div>
                        <div class="col-md-3">
                            <label>计量单位 :</label>
                            <div class="form-group">
                                <input class="form-control" type="text" name="unit" style="float:right;width:70%"
                                    [(ngModel)]="wl.materialForProduct.unit">
                            </div>
                        </div>
                        <div class="col-md-3">
                            <label>副计量单位 :</label>
                            <div class="form-group">
                                <input class="form-control" type="text" name="deputyUnit" style="float:right;width:62%"
                                    [(ngModel)]="wl.materialForProduct.deputyUnit">
                            </div>

                        </div>
                    </div>

                    <div class="row">
                        <div class="col-md-3">
                            <label>特殊记载 :</label>
                            <div class="form-group">
                                <input class="form-control" type="text" name="specialRecord" style="float:right;width:70%"
                                    [(ngModel)]="wl.materialForProduct.specialRecord">
                            </div>
                        </div>
                        <div class="col-md-3">
                            <label>车间备注 :</label>
                            <div class="form-group">
                                <input class="form-control" type="text" name="workshopRemark" style="float:right;width:70%"
                                    [(ngModel)]="wl.materialForProduct.workshopRemark">
                            </div>

                        </div>
                        <div class="col-md-3">
                            <label>用途 :</label>
                            <div class="form-group">
                                <input class="form-control" type="text" name="materialUseFor" style="float:right;width:75%"
                                    [(ngModel)]="wl.materialForProduct.materialUseFor">
                            </div>
                        </div>


                    </div>
                                </div>



                    <h5 class="mb-4" style="font-weight: 600;margin-top: 20px;">
                            <i class="fa fa-list"></i> 时间信息</h5>
                            <div style="border:1px solid #e9ecef ;padding: 10px">
                                    <div class="row" >
                                            <div class="col-md-3">
                                                    <label>生产日期 :</label>
                                                    <div class="form-group">
                                                        <p-calendar [(ngModel)]="productionDate" name="productionDate" dateFormat="yy-mm-dd" [ngStyle]="{ 'width': '60%' }">
                                                        </p-calendar>
                                                    </div>
                                                </div>
                                            <div class="col-md-3">
                                                    <label>存储期止 :</label>
                                                    <div class="form-group">
                                                        <p-calendar [(ngModel)]="storageDateEnd" name="storageDateEnd" dateFormat="yy-mm-dd">
                                                        </p-calendar>
                                                    </div>
                                                </div>
                                            <div class="col-md-3">
                                                <label>复验有限期自 :</label>
                                                <div class="form-group">
                                                    <p-calendar [(ngModel)]="recheckValidDateFrom" name="recheckValidDateFrom"
                                                        dateFormat="yy-mm-dd"></p-calendar>
                                                </div>
                                            </div>
                                            <div class="col-md-3">
                                                <label>复验有限期止 :</label>
                                                <div class="form-group">
                                                    <p-calendar [(ngModel)]="recheckValidDateEnd" name="recheckValidDateEnd"
                                                        dateFormat="yy-mm-dd"></p-calendar>
                                                </div>
                                            </div>
                                        </div>
                            </div>

                    <div class="row" style="margin-top:20px;">
                        <div class="col-md-12">
                            <selectLocation [(location)]="positionId"></selectLocation>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button [disabled]="saving" type="button" class="btn btn-secondary"
                        (click)="close()">{{l("Cancel")}}</button>
                    <button type="submit" class="btn btn-primary" [disabled]="!roleForm.form.valid && positionId"
                        [buttonBusy]="saving" [busyText]="l('SavingWithThreeDot')"><i class="fa fa-save"></i>
                        <span>{{l("Save")}}</span></button>
                </div>

            </form>

        </div>
    </div>
</div>
